export default
    function(value){
        if(!value)return
        var date = Date.parse(new Date(value));
        var nowtimestamp = Date.parse(new Date());
        var timestamp = nowtimestamp-date;
        if(timestamp>=31104000000){
            var year = parseInt(timestamp/1000/60/60/24/30/12);
        }else if(timestamp>=2592000000){
            var month = parseInt(timestamp/1000/60/60/24/30);
        }else if(timestamp>=604800000){
            var week = parseInt(timestamp/1000/60/60/24/7);
        }else if(timestamp>=86400000){
             var day = parseInt(timestamp/1000/60/60/24);
        }else if(timestamp>=3600000){
            var hour = parseInt(timestamp/1000/60/60);
        }else{
            var minute = parseInt(timestamp/1000/60);
        }    
        
        if(year>=1){
            return year+"年前"
        }else if(month>=1){
            return month+"月前"
        }else if(week>=1){
            return week + "周前"
        }else if(day>=1){
            return day + "天前"
        }else if(hour>=1){
            return hour + "小时前"
        }else if(minute>=1){
            return minute + "分钟前"
        }else{
            return "刚刚"
        }
    }